/**
 * futures : masterlink.futures.vo.Futcan.java
 */
package masterlink.futures.vo;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Entity;
import javax.persistence.Id;

/**
 * TODO Write the description
 *
 * @author : tonyyang
 * Create date : 2012/3/13
 * @version 1.0.0	
 */
@Entity
public class Futcan implements Serializable{

	private static final long serialVersionUID = 1226042507069615789L;
	@Id
	private ID id;
	@Column(name="trid")
	private String trid;
	@Column(name="setMonth")
	private Integer setMonth;
	@Column(name="strikePrice")
	private Double strikePrice;
	@Column(name="buysell")
	private String buysell;
	@Column(name="sprdate")
	private Integer sprdate;
	@Column(name="coverqty")
	private Long coverqty;
	@Column(name="coverincome")
	private Double coverincome;
	@Column(name="matchPrice")
	private Double matchPrice;
	@Column(name="fee")
	private Double fee;
	@Column(name="tax")
	private Double tax;
	@Column(name="name")
	private String name;
	
	/**
	 * @return the id
	 */
	public ID getId() {
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(ID id) {
		this.id = id;
	}

	/**
	 * @return the trid
	 */
	public String getTrid() {
		return trid;
	}

	/**
	 * @param trid the trid to set
	 */
	public void setTrid(String trid) {
		this.trid = trid;
	}

	/**
	 * @return the setMonth
	 */
	public Integer getSetMonth() {
		return setMonth;
	}

	/**
	 * @param setMonth the setMonth to set
	 */
	public void setSetMonth(Integer setMonth) {
		this.setMonth = setMonth;
	}

	/**
	 * @return the strikePrice
	 */
	public Double getStrikePrice() {
		return strikePrice;
	}

	/**
	 * @param strikePrice the strikePrice to set
	 */
	public void setStrikePrice(Double strikePrice) {
		this.strikePrice = strikePrice;
	}

	/**
	 * @return the buysell
	 */
	public String getBuysell() {
		return buysell;
	}

	/**
	 * @param buysell the buysell to set
	 */
	public void setBuysell(String buysell) {
		this.buysell = buysell;
	}

	/**
	 * @return the sprdate
	 */
	public Integer getSprdate() {
		return sprdate;
	}

	/**
	 * @param sprdate the sprdate to set
	 */
	public void setSprdate(Integer sprdate) {
		this.sprdate = sprdate;
	}

	/**
	 * @return the coverqty
	 */
	public Long getCoverqty() {
		return coverqty;
	}

	/**
	 * @param coverqty the coverqty to set
	 */
	public void setCoverqty(Long coverqty) {
		this.coverqty = coverqty;
	}

	/**
	 * @return the coverincome
	 */
	public Double getCoverincome() {
		return coverincome;
	}

	/**
	 * @param coverincome the coverincome to set
	 */
	public void setCoverincome(Double coverincome) {
		this.coverincome = coverincome;
	}

	/**
	 * @return the matchPrice
	 */
	public Double getMatchPrice() {
		return matchPrice;
	}

	/**
	 * @param matchPrice the matchPrice to set
	 */
	public void setMatchPrice(Double matchPrice) {
		this.matchPrice = matchPrice;
	}

	/**
	 * @return the fee
	 */
	public Double getFee() {
		return fee;
	}

	/**
	 * @param fee the fee to set
	 */
	public void setFee(Double fee) {
		this.fee = fee;
	}

	/**
	 * @return the tax
	 */
	public Double getTax() {
		return tax;
	}

	/**
	 * @param tax the tax to set
	 */
	public void setTax(Double tax) {
		this.tax = tax;
	}

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("Futcan [id=");
		builder.append(id);
		builder.append(", trid=");
		builder.append(trid);
		builder.append(", setMonth=");
		builder.append(setMonth);
		builder.append(", strikePrice=");
		builder.append(strikePrice);
		builder.append(", buysell=");
		builder.append(buysell);
		builder.append(", sprdate=");
		builder.append(sprdate);
		builder.append(", coverqty=");
		builder.append(coverqty);
		builder.append(", coverincome=");
		builder.append(coverincome);
		builder.append(", matchPrice=");
		builder.append(matchPrice);
		builder.append(", fee=");
		builder.append(fee);
		builder.append(", tax=");
		builder.append(tax);
		builder.append("]");
		return builder.toString();
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		return result;
	}

	/* (non-Javadoc)
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof Futcan))
			return false;
		Futcan other = (Futcan) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		return true;
	}

	@Embeddable
	public static class ID implements Serializable{

		private static final long serialVersionUID = -7924450830206602533L;
		@Column(name="date1")
		private Integer date1;
		@Column(name="broker_id")
		private String brokerId;
		@Column(name="ib")
		private String ib;
		@Column(name="acno")
		private String acno;
		@Column(name="coverSeqno")
		private Long coverSeqno;
		@Column(name="coverNum")
		private Long coverNum;
		/**
		 * @return the date1
		 */
		public Integer getDate1() {
			return date1;
		}
		/**
		 * @param date1 the date1 to set
		 */
		public void setDate1(Integer date1) {
			this.date1 = date1;
		}
		/**
		 * @return the brokerId
		 */
		public String getBrokerId() {
			return brokerId;
		}
		/**
		 * @param brokerId the brokerId to set
		 */
		public void setBrokerId(String brokerId) {
			this.brokerId = brokerId;
		}
		/**
		 * @return the ib
		 */
		public String getIb() {
			return ib;
		}
		/**
		 * @param ib the ib to set
		 */
		public void setIb(String ib) {
			this.ib = ib;
		}
		/**
		 * @return the acno
		 */
		public String getAcno() {
			return acno;
		}
		/**
		 * @param acno the acno to set
		 */
		public void setAcno(String acno) {
			this.acno = acno;
		}
		/**
		 * @return the coverSeqno
		 */
		public Long getCoverSeqno() {
			return coverSeqno;
		}
		/**
		 * @param coverSeqno the coverSeqno to set
		 */
		public void setCoverSeqno(Long coverSeqno) {
			this.coverSeqno = coverSeqno;
		}
		/**
		 * @return the coverNum
		 */
		public Long getCoverNum() {
			return coverNum;
		}
		/**
		 * @param coverNum the coverNum to set
		 */
		public void setCoverNum(Long coverNum) {
			this.coverNum = coverNum;
		}
		/* (non-Javadoc)
		 * @see java.lang.Object#toString()
		 */
		@Override
		public String toString() {
			StringBuilder builder = new StringBuilder();
			builder.append("ID [date1=");
			builder.append(date1);
			builder.append(", brokerId=");
			builder.append(brokerId);
			builder.append(", ib=");
			builder.append(ib);
			builder.append(", acno=");
			builder.append(acno);
			builder.append(", coverSeqno=");
			builder.append(coverSeqno);
			builder.append(", coverNum=");
			builder.append(coverNum);
			builder.append("]");
			return builder.toString();
		}
		/* (non-Javadoc)
		 * @see java.lang.Object#hashCode()
		 */
		@Override
		public int hashCode() {
			final int prime = 31;
			int result = 1;
			result = prime * result + ((acno == null) ? 0 : acno.hashCode());
			result = prime * result
					+ ((brokerId == null) ? 0 : brokerId.hashCode());
			result = prime * result
					+ ((coverNum == null) ? 0 : coverNum.hashCode());
			result = prime * result
					+ ((coverSeqno == null) ? 0 : coverSeqno.hashCode());
			result = prime * result + ((date1 == null) ? 0 : date1.hashCode());
			result = prime * result + ((ib == null) ? 0 : ib.hashCode());
			return result;
		}
		/* (non-Javadoc)
		 * @see java.lang.Object#equals(java.lang.Object)
		 */
		@Override
		public boolean equals(Object obj) {
			if (this == obj)
				return true;
			if (obj == null)
				return false;
			if (!(obj instanceof ID))
				return false;
			ID other = (ID) obj;
			if (acno == null) {
				if (other.acno != null)
					return false;
			} else if (!acno.equals(other.acno))
				return false;
			if (brokerId == null) {
				if (other.brokerId != null)
					return false;
			} else if (!brokerId.equals(other.brokerId))
				return false;
			if (coverNum == null) {
				if (other.coverNum != null)
					return false;
			} else if (!coverNum.equals(other.coverNum))
				return false;
			if (coverSeqno == null) {
				if (other.coverSeqno != null)
					return false;
			} else if (!coverSeqno.equals(other.coverSeqno))
				return false;
			if (date1 == null) {
				if (other.date1 != null)
					return false;
			} else if (!date1.equals(other.date1))
				return false;
			if (ib == null) {
				if (other.ib != null)
					return false;
			} else if (!ib.equals(other.ib))
				return false;
			return true;
		}
		
		
		
	}

}
